1. Field of the Invention
Apparatuses and methods consistent with the present invention relate to image encoding and image decoding, and more particularly, to image encoding which improves prediction efficiency and compression efficiency in accordance with image characteristics by performing prediction in lines and performing a one-dimensional transformation in lines on an input image.
2. Description of the Related Art
In general, according to video compression standards such as Moving Picture Experts Group (MPEG)-1, MPEG-2, MPEG-4 Visual, H.261, H.263 and H.264, image data is compressed by dividing an image frame into a plurality of image blocks, performing prediction on the image blocks and thereby obtaining prediction blocks, and transforming and quantizing differences between the original image blocks and the prediction blocks.
The prediction performed may be intra prediction or inter prediction. Intra prediction is performed on a current image block by using data of restored neighboring blocks, which is included in the current image block. Inter prediction is performed by generating a prediction block that corresponds to a current image block from one or more video frames previously encoded using a block-based motion compensation method. According to related art methods, generally, data of neighboring blocks used for intra prediction comprises pixels of neighboring previous blocks, which are adjacent to the top and left of the current image block. In this case, top and left pixels of the current image block, which are adjacent to pixels of previous blocks, have small differences between prediction values and original pixel values due to their close distances from the pixels of the previous blocks. However, pixels of the current image block, which are disposed far from the pixels of the previous blocks, may have large differences between prediction values and original pixel values.
Meanwhile, according to H.264 standards, two-dimensional discrete cosine transformation (DCT) is performed on residual data obtained by using inter prediction or intra prediction in 4×4 blocks. According to related art Joint Photographic Experts Group (JPEG), MPEG-1, MPEG-2, and MPEG-4 standards, two-dimensional DCT is performed on the residual data in 8×8 blocks. In the two-dimensional DCT, although horizontal or vertical correlations exist in the residual data, the correlations between data in a residual block may not be efficiently used.
Thus, a method of image encoding which improves compression efficiency by improving prediction efficiency is desired in order to cope with a restriction of a transmission bandwidth and provide an image having higher quality to a user.